<?php

class ResetPassForm extends CFormModel
{
	public $password;
	public $re_password;
	public $verifyCode;


	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return User the static model class
	 */
	public static function model($className=__CLASS__){
		return parent::model($className);
	}
	/**
	 * Declares the validation rules.
	 * The rules state that username and password are required,
	 * and password needs to be authenticated.
	 */
	public function rules()
	{
		return array(
			array('password', 'required', 'message' => Yii::t('msg', '0006')),
			array('re_password', 'compare','compareAttribute' => 'password', 'message' => Yii::t('msg', '0007')),
			array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements(), 'message' => Yii::t('msg', '0009')),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'password' => Yii::t('lbl' , '0004'),
			're_password' => Yii::t('lbl' , '0005'),
			'verifyCode'=> Yii::t('lbl', '0008', array()),
		);
	}
}
